package cn.edu.scau.cmi.wurihua.OrganizeModel;

import java.util.ArrayList;
import java.util.List;

public class Root {
	private List<PersonalOrganization> pOrganizationList = new ArrayList<PersonalOrganization>(); 
	private List<TeamOrganization> tOrganizationList = new ArrayList<TeamOrganization>();
	
	public void addOrganization(TeamOrganization organization) {
		tOrganizationList.add(organization);
	}
	
	public void display() {
		System.out.println("root:");
		if(tOrganizationList!=null) {
			for(TeamOrganization organization:tOrganizationList) {
				organization.display();
			}
		}
	}
	
	public TeamOrganization find(String name) {
		for(TeamOrganization to:tOrganizationList) {
			if(to.getName().equals(name)==true)
				return to;
		}
		return null;
	}
}
